.flow-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  transform-origin: 50% 0 0;
  text-align: left;
}

.node-wrap-box {
  position: relative;
  width: 220px;
  min-height: 72px;
  background-color: #fff;
  border-radius: 4px;
  cursor: pointer;

  &.approver:before,
  &.copy:before {
    content: '';
    position: absolute;
    top: -12px;
    left: 50%;
    -webkit-transform: translateX(-50%);
    transform: translateX(-50%);
    width: 0;
    height: 4px;
    border-style: solid;
    border-width: 8px 6px 4px;
    border-color: #cacaca transparent transparent;
    background-color: #f5f5f7;
  }

  &:after {
    pointer-events: none;
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    border-radius: 4px;
    border: 1px solid transparent;
    transition: all 0.1s cubic-bezier(0.645, 0.045, 0.355, 1);
    box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.1);
  }
  &.error {
    &:after {
      border-color: #f25643;
    }
  }

  &:hover {
    &:after {
      border-color: #3296fa;
      box-shadow: 0 0 6px 0 rgba(50, 150, 250, 0.3);
    }

    .sort-left,
    .sort-right {
      display: flex;
      align-items: center;
    }
  }

  &.start:hover:after {
    border-color: #576a95;
  }

  &.copy:hover:after {
    border-color: #3296fa;
  }

  &.approver:hover:after {
    border-color: #ff9431;
  }

  .error-tip {
    position: absolute;
    top: 0;
    right: 0;
    transform: translateX(150%);
    font-size: 24px;
    color: #f25643;
  }

  .title {
    border-radius: 4px 4px 0px 0px;
    color: #fff;
    font-size: 12px;
    padding-left: 16px;
    padding-right: 30px;
    height: 24px;
    line-height: 24px;
    position: relative;
    display: flex;
    align-items: center;

    &:before {
      content: '';
      position: absolute;
      left: 0;
      right: 40px;
      top: 0;
      bottom: 0;
    }
  }

  .title-left-icon {
    font-size: 12px;
    margin-right: 5px;
  }

  .title-right-icon {
    font-size: 16px;
    position: absolute;
    right: 10px;
    top: 0;
    color: #fff;
    display: none;
  }

  .title-text {
    line-height: 15px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    border-bottom: dashed 1px transparent;
  }

  &:not(.start):hover {
    .title-text {
      border-bottom-color: #fff;
    }

    .title-right-icon {
      display: block;
    }
  }

  &.condition:hover {
    .title-text {
      border-bottom-color: #15bc83;
    }

    .title-right-icon {
      color: rgba(25, 31, 37, 0.56);
      font-size: 14px;
      right: 0;
    }

    .priority-title {
      display: none;
    }
  }

  // 起始节点
  &.start .title {
    background-color: #576a95;
  }

  // 审批人
  &.approver .title {
    background-color: #ff9431;
  }

  // 抄送人
  &.copy .title {
    background-color: #3296fa;
  }

  // 条件
  &.condition {
    padding: 14px 19px;

    .content {
      padding: 0;
      margin-top: 10px;
    }

    .arrow {
      display: none;
    }

    .title {
      position: relative;
      font-size: 12px;
      color: #15bc83;
      text-align: left;
      line-height: 16px;
      justify-content: space-between;
      padding: 0;
      height: auto;

      .title-left-icon {
        display: none;
      }

      .title-text {
        max-width: 120px;
      }

      .priority-title {
        color: rgba(25, 31, 37, 0.56);
        margin-right: 10px;
      }
    }
  }

  .content {
    position: relative;
    font-size: 14px;
    padding: 16px 30px 16px 16px;

    .text {
      overflow: hidden;
      text-overflow: ellipsis;
      display: -webkit-box;
      -webkit-line-clamp: 3;
      -webkit-box-orient: vertical;
    }

    .arrow {
      width: 20px;
      height: 14px;
      font-size: 14px;
      color: #979797;
      position: absolute;
      top: 50%;
      right: 10px;
      transform: translateY(-50%);
      margin-top: -1px;
    }
  }

  .sort-left,
  .sort-right {
    position: absolute;
    top: 0;
    bottom: 0;
    display: none;

    > i {
      font-size: 12px;
      color: rgba(25, 31, 37, 0.56);
    }

    &:hover {
      background: #efefef;
      border-color: rgba(25, 31, 37, 0.08);
    }
  }

  .sort-left {
    left: 0;
    border-right: 1px solid #f6f6f6;
  }

  .sort-right {
    right: 0;
    border-left: 1px solid #f6f6f6;
  }
}

.add-node-btn-box {
  width: 220px;
  display: flex;
  flex-shrink: 0;
  justify-content: center;
  height: 100px;
  position: relative;
  padding-top: 30px;
  margin: auto;

  &:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    //z-index: -1;
    margin: auto;
    width: 2px;
    height: 100%;
    background-color: #cacaca;
  }

  .btn {
    outline: none;
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1);
    width: 30px;
    height: 30px;
    background-color: #3296fa;
    border-radius: 50%;
    position: relative;
    border: none;
    line-height: 28px;
    transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);

    &:hover {
      transform: scale(1.3);
      box-shadow: 0 13px 27px 0 rgba(0, 0, 0, 0.1);
    }

    &:active {
      transform: none;
      background: #1e83e9;
      box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1);
    }

    > i {
      color: #fff;
      font-size: 18px;
    }
  }
}

.branch-box-wrap {
  display: inline-flex;
  align-items: center;
}

.branch-box {
  display: flex;
  overflow: visible;
  min-height: 180px;
  height: auto;
  border-bottom: 2px solid #cccccc;
  border-top: 2px solid #cccccc;
  position: relative;
  margin-top: 15px;

  > .add-branch {
    border: none;
    outline: none;
    user-select: none;
    font-size: 12px;
    padding: 0 10px;
    height: 30px;
    line-height: 30px;
    border-radius: 15px;
    color: #0089ff;
    background-color: #fff;
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1);
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    transform-origin: center center;
    cursor: pointer;
    z-index: 1;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);

    &:hover {
      transform: translateX(-50%) scale(1.1);
      box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.1);
    }

    &:active {
      transform: translateX(-50%);
      box-shadow: none;
    }
  }

  > .col-box {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding: 30px 50px 0;

    &:first-of-type:before,
    &:first-of-type:after,
    &:last-of-type:before,
    &:last-of-type:after {
      content: '';
      width: calc(50% - 1px);
      height: 3px;
      background-color: #f5f5f7;
      position: absolute;
    }

    &:first-of-type:before {
      left: 0;
      top: -2px;
    }

    &:first-of-type:after {
      left: 0;
      bottom: -2px;
    }

    &:last-of-type:before {
      right: 0;
      top: -2px;
    }

    &:last-of-type:after {
      right: 0;
      bottom: -2px;
    }

    &:first-of-type .sort-left {
      display: none !important;
    }

    &:last-of-type .sort-right {
      display: none !important;
    }

    .center-line {
      position: absolute;
      width: 2px;
      background-color: #cacaca;
      top: 0;
      bottom: 0;
    }
  }
}

.end-node {
  text-align: center;
  font-size: 14px;
  color: rgba(25, 31, 37, 0.4);

  &:before {
    content: '';
    display: block;
    width: 10px;
    height: 10px;
    margin: 0 auto 8px;
    border-radius: 50%;
    background-color: #dbdcdc;
  }
}
.add-node-popover-body {
  max-width: 290px;
  .add-node-popover-item {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    color: #191f25;
    margin-right: 8px;
    margin-bottom: 8px;
    width: 140px;
    background-color: rgba(17, 31, 44, 0.02);
    padding: 8px;
    border: 1px solid #ffffff;
    border-radius: 4px;
    transition: all 0.3s ease-in-out;
    &:hover {
      background: #ffffff;
      border: 1px solid #ecedef;
      box-shadow: 0 2px 8px 0 rgba(17, 31, 44, 0.08);
    }
    &.approver .item-wrapper {
      color: #ff943e;
    }
    &.copy {
      margin-right: 0;
      .item-wrapper {
        color: #3296fa;
      }
    }
    &.branch {
      margin-bottom: 0;
      .item-wrapper {
        color: #15bc83;
      }
    }
  }
  .item-wrapper {
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    background: #ffffff;
    border: 1px solid #eeeeee;
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
    margin-right: 12px;
    > i {
      font-size: 20px;
    }
  }
}
